<template>
  <div class="aaa">
    我是aaa---------{{ msg }}
    <el-button @click="toB">传消息给b</el-button>
    <el-button @click="btnClick">调用父级的方法</el-button>
  </div>
</template>
<script>
export default {
  inject: {
    msg: {
      type: String
    },
    that: {
      type: Object
    }
  },
  methods: {
    toB() {
      this.$bus.$emit('atob', 999)
    },
    btnClick() {
      this.that.getData(123)
    }
  }
}
</script>
<style lang="scss" scoped>
.aaa {
  width: 300px;
  height: 300px;
  border: 5px solid red;
}
</style>
